<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>GRMustache Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 961)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">GRMustache 7.3 </a></h1>
				<a id="developerHome" href="../index.html">Gwendal Roué</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">GRMustache Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	
	
	<option value="class_methods">Class Methods</option>
	
	<option value="//api/name/libraryVersion">&nbsp;&nbsp;&nbsp;&nbsp;+ libraryVersion</option>
	
	<option value="//api/name/preventNSUndefinedKeyExceptionAttack">&nbsp;&nbsp;&nbsp;&nbsp;+ preventNSUndefinedKeyExceptionAttack</option>
	
	<option value="//api/name/renderingObjectForObject:">&nbsp;&nbsp;&nbsp;&nbsp;+ renderingObjectForObject:</option>
	
	<option value="//api/name/renderingObjectWithBlock:">&nbsp;&nbsp;&nbsp;&nbsp;+ renderingObjectWithBlock:</option>
	
	<option value="//api/name/standardLibrary">&nbsp;&nbsp;&nbsp;&nbsp;+ standardLibrary</option>
	
	
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Getting the GRMustache version">Getting the GRMustache version</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Preventing NSUndefinedKeyException in Development configuration">Preventing NSUndefinedKeyException in Development configuration</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Standard Library">Standard Library</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Building rendering objects">Building rendering objects</a></span></li>
	
</ul></li>







<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/libraryVersion">libraryVersion</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/preventNSUndefinedKeyExceptionAttack">preventNSUndefinedKeyExceptionAttack</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/renderingObjectForObject:">renderingObjectForObject:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/renderingObjectWithBlock:">renderingObjectWithBlock:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/standardLibrary">standardLibrary</a></span></li>
	
</ul></li>




			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="GRMustache Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">GRMustache Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">GRMustache.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>The GRMustache class provides with global-level information and configuration
of the GRMustache library.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Getting the GRMustache version" name="task_Getting the GRMustache version"></a>
						<h3 class="subsubtitle task-title">Getting the GRMustache version</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/libraryVersion">+&nbsp;libraryVersion</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Preventing NSUndefinedKeyException in Development configuration" name="task_Preventing NSUndefinedKeyException in Development configuration"></a>
						<h3 class="subsubtitle task-title">Preventing NSUndefinedKeyException in Development configuration</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/preventNSUndefinedKeyExceptionAttack">+&nbsp;preventNSUndefinedKeyExceptionAttack</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Standard Library" name="task_Standard Library"></a>
						<h3 class="subsubtitle task-title">Standard Library</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/standardLibrary">+&nbsp;standardLibrary</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Building rendering objects" name="task_Building rendering objects"></a>
						<h3 class="subsubtitle task-title">Building rendering objects</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/renderingObjectForObject:">+&nbsp;renderingObjectForObject:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/renderingObjectWithBlock:">+&nbsp;renderingObjectWithBlock:</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					
					
					<div class="section section-methods">
						<a title="Class Methods" name="class_methods"></a>
						<h2 class="subtitle subtitle-methods">Class Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/libraryVersion" title="libraryVersion"></a>
	<h3 class="subsubtitle method-title">libraryVersion</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The version of GRMustache as a GRMustacheVersion struct.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (GRMustacheVersion)libraryVersion</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The version of GRMustache as a GRMustacheVersion struct.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v7.0</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/preventNSUndefinedKeyExceptionAttack" title="preventNSUndefinedKeyExceptionAttack"></a>
	<h3 class="subsubtitle method-title">preventNSUndefinedKeyExceptionAttack</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Have GRMustache avoid most <code>NSUndefinedKeyExceptions</code> when rendering
templates.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (void)preventNSUndefinedKeyExceptionAttack</code></div>

    
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v1.7</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>The rendering of a GRMustache template can lead to <code>NSUndefinedKeyExceptions</code>
to be raised, because of the usage of the <code>valueForKey:</code> method. Those
exceptions are nicely handled by GRMustache, and are part of the regular
rendering of a template.</p>

<p>Unfortunately, Objective-C exceptions have several drawbacks, particularly:</p>

<ol>
<li>they play badly with autorelease pools, and are reputed to leak memory.</li>
<li>they usually stop your debugger when you are developping your application.</li>
</ol>


<p>The first point is indeed a matter of worry: Apple does not guarantee that
exceptions raised by <code>valueForKey:</code> do not leak memory. However, I never had
any evidence of such a leak from NSObject&rsquo;s implementation.</p>

<p>Should you still worry, we recommend that you avoid the <code>valueForKey:</code> method
altogether. Instead, implement the <a href="http://clang.llvm.org/docs/ObjectiveCLiterals.html#dictionary-style-subscripting">keyed subscripting</a>
<code>objectForKeyedSubscript:</code> method on objects that you provide to GRMustache.</p>

<p>The second point is valid also: NSUndefinedKeyException raised by template
rendering may become a real annoyance when you are debugging your project,
because it&rsquo;s likely you&rsquo;ve told your debugger to stop on every Objective-C
exceptions.</p>

<p>You can avoid them as well: make sure you invoke once, early in your
application, the <code>preventNSUndefinedKeyExceptionAttack</code> method.</p>

<p>Depending on the number of NSUndefinedKeyException that get prevented, you
will experience a slight performance hit, or a performance improvement.</p>

<p>Since the main use case for this method is to avoid Xcode breaks on rendering
exceptions, the best practice is to conditionally invoke this method, using
the <a href="[http://developer.apple.com/library/mac/](http://developer.apple.com/library/mac/">NS_BLOCK_ASSERTIONS</a>#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html)
that helps identifying the Debug configuration of your targets:</p>

<pre><code>#if !defined(NS_BLOCK_ASSERTIONS)
// Debug configuration: keep GRMustache quiet
[GRMustache preventNSUndefinedKeyExceptionAttack];
#endif
</code></pre>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/runtime.md">https://github.com/groue/GRMustache/blob/master/Guides/runtime.md</a></p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/renderingObjectForObject:" title="renderingObjectForObject:"></a>
	<h3 class="subsubtitle method-title">renderingObjectForObject:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>This method is deprecated. Use
<a href="../Classes/GRMustacheRendering.html#//api/name/renderingObjectForObject:"><code>[GRMustacheRendering renderingObjectForObject:]</code></a> instead. (<b class="deprecated">Deprecated:</b><span class="deprecated"> v7.0</span>)</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (id&lt;GRMustacheRendering&gt;)renderingObjectForObject:(id)<em>object</em></code></div>

    
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.0</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Classes/GRMustacheRendering.html">GRMustacheRendering</a> class</p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/renderingObjectWithBlock:" title="renderingObjectWithBlock:"></a>
	<h3 class="subsubtitle method-title">renderingObjectWithBlock:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>This method is deprecated. Use
<a href="../Classes/GRMustacheRendering.html#//api/name/renderingObjectWithBlock:"><code>[GRMustacheRendering renderingObjectWithBlock:]</code></a> instead. (<b class="deprecated">Deprecated:</b><span class="deprecated"> v7.0</span>)</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (id&lt;GRMustacheRendering&gt;)renderingObjectWithBlock:(NSString *( ^ ) ( GRMustacheTag *tag , GRMustacheContext *context , BOOL *HTMLSafe , NSError **error ))<em>block</em></code></div>

    
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.0</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Classes/GRMustacheRendering.html">GRMustacheRendering</a> class</p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustache.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/standardLibrary" title="standardLibrary"></a>
	<h3 class="subsubtitle method-title">standardLibrary</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>The GRMustache standard library.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (NSObject *)standardLibrary</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The GRMustache standard library.</p>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/standard_library.md">https://github.com/groue/GRMustache/blob/master/Guides/standard_library.md</a></p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.4</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustache.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 Gwendal Roué. All rights reserved. (Last updated: 2014-09-13)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>